package hoster;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class doctor  {
    public static void main(String[] args) {
        doctor m1 = new doctor(8,40);
        doctor m2 = new doctor(6,50);
        doctor m3 = new doctor(7,60);
        List<doctor> any = new ArrayList<>();
        any.add(m1);
        any.add(m2);
        any.add(m3);
        Collections.sort(any,new doctorComparator());
        for (doctor one: any) {
            System.out.println(one.time);
        }
        System.out.println("-------------------");
        System.out.println("升序排序");
        Collections.sort(any,Collections.reverseOrder(new doctorComparator()));
        for (doctor one: any) {
            System.out.println(one.time);
        }
        System.out.println("-------------------");
        System.out.println("降序排序");

        Collections.shuffle(any);
        for (doctor one: any) {
            System.out.println(one.time);
        }
        System.out.println("-------------------");
        System.out.println("随机排序");
        System.out.println(Collections.max(any,new doctorComparator()).time);
    }
    // private String name;
    public double time;
    public int number;
    public doctor(int number, double time) {
        this.number = number;
        this.time = time;
    }

    public double getTime() {
        return time;
    }

    public void setTime(double time) {
        this.time = time;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
}

